@extends('admin.index')
@section('content')
<body>
<form action="{{url ('admin/comment')}}" method='post' name='myform'>
    <input type='hidden' name='_token' value='{{ csrf_token() }}' >
    <input type='hidden' name='_method' value='DELETE'>
</form>
<form action="{{url ('admin/comment')}}">
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 留言管理</strong></div>
    <div class="padding border-bottom">
      <ul class="search">
        <li>
          <input type="text" placeholder="请输入搜索关键字" name="keywords" class="input" style="width:250px; line-height:17px;display:inline-block" />
          <input type="submit" class="button border-main icon-search" value="搜索">
        @if (session('msg'))
            <div class="alert alert-success">
                {{ session('msg') }}
            </div>
        @endif
        </li>
      </ul>
    </div>
    <table class="table table-hover text-center">
      <tr>
        <th width="120">ID</th>
        <th width='10%'>商品名称</th>
        <th>用户名</th>
        <th>电话</th>
        <th width="25%">内容</th>
        <th width='10%'>排序</th>
        <th>操作</th>       
      </tr>
         @foreach ($list as $v)
        <tr>
            <td><input type="checkbox" name="id[]" value="1" />{{ $v->id }}</td>
            <td>{{ $v->title }}</td>
            <td>{{ $v->username }}</td>
            <td>{{ $v->phone }}</td>         
            <td>{{ $v->content }}</td>
            <td>{{ $v->path}}</td>
            <td><div class="button-group"><a class="button border-red" href="javascript:del( {{$v->id}} )" ><span class="icon-trash-o"></span> 删除</a> </div></td>          
            <td><div class="button-group"><a class="button border-red" href="{{url ('admin/commentSon').'/'.$v->id}}"><span class="icon-trash-o"></span>回复评论</a> </div></td>          
        </tr>
        @endforeach
    </table>
  </div>
</form>
<script type="text/javascript">

function del(id){
	if(confirm("您确定要删除吗?")){
		var form = document.myform;
    form.action = '/admin/comment/'+id;
    form.submit();
	}
}
</script>
{{ $list-> appends($where)->links() }}
</body>
@stop
